<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActivityTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activities', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 128)->comment('标题');
            $table->integer('product_id')->comment('商品ID');
            $table->tinyInteger('type')->default(1)->comment('类型，1-限量，2-限时');
            $table->integer('quantity')->comment('数量');
            $table->timestamp('start_time')->comment('开始时间');
            $table->timestamp('end_time')->nullable()->comment('结束时间');
            $table->boolean('status')->defalut(false)->comment('审核状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activities');
    }
}
